package com.mall.controller;


import com.mall.pojo.GoodsFreightPo;
import com.mall.pojo.GoodsStockPo;
import com.mall.service.GoodsFreightService;
import com.mall.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 运费表 前端控制器
 * </p>
 *
 * @author zhangshiqi
 * @since 2020-09-13
 */
@RestController
@RequestMapping("/goodsFreight/")
public class GoodsFreightController {

    @Autowired
    private GoodsFreightService goodsFreightService;

    /**
     * 分页查询运费数据
     */
    @RequestMapping("doFindPageObject")
    public SysResult doFindPageObject(String freightName, Integer pageCurrent) {
        return SysResult.success(goodsFreightService.doFindPageObject(freightName, pageCurrent));
    }

    /**
     * 删除运费数据
     */
    @RequestMapping("doDeleteObjects")
    public SysResult doDeleteObjects(String ids) {
        goodsFreightService.doDeleteObjects(ids);
        return SysResult.success();
    }

    /**
     * 新增运费数据
     */
    @RequestMapping("doAddObjects")
    public SysResult doAddObjects(GoodsFreightPo goodsFreightPo) {
        goodsFreightService.doAddObjects(goodsFreightPo);
        return SysResult.success();
    }

    /**
     * 根据ID查询运费数据
     */
    @RequestMapping("doFindGoodsFreightById")
    public SysResult doFindGoodsFreightById(String id) {
        return SysResult.success(goodsFreightService.doFindGoodsFreightById(id));
    }

    /**
     * 修改运费数据
     */
    @RequestMapping("doUpdateObjects")
    public SysResult doUpdateObjects(GoodsFreightPo goodsFreightPo) {
        goodsFreightService.doUpdateObjects(goodsFreightPo);
        return SysResult.success();
    }
}

